Dynomotion

Group: DynoMotion Message: 2609 From: himykabibble Date: 12/5/2011
Subject: Thread Switching....
Tom,

Am I correct in assuming you are doing pre-emptive task switching, and that if a thread does not cede control before its timeslice is up, it will be suspended until its turn comes around again?

Is there any way to *know* a thread has exceeded its timeslice?

Regards,
Ray L.
Group: DynoMotion Message: 2610 From: Tom Kerekes Date: 12/5/2011
Subject: Re: Thread Switching....
Hi Ray,
 
Yes see:
 
 
The example
 
Measure IRQ.c
 
uses a simple method of watching the time and when is sees a gap of more than 10us it knows it has been pre-empted.
 
There is also a counter which increments each servo interrupt where any change would indicate it has been pre-empted 
 
extern
volatile double ServoTick; // increments each servo interrupt
 
Regards
TK
 
Group: DynoMotion Message: 2612 From: himykabibble Date: 12/5/2011
Subject: Re: Thread Switching....
Tom,

Thanks. Having the ServoTick solves another problem for me as well.

Regards,
Ray L.

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Ray,
>  
> Yes see:
>  
> http://dynomotion.com/Help/Multitasking.htm
>  
> The example
>  
> Measure IRQ.c
>  
> uses a simple method of watching the time and when is sees a gap of more than 10us it knows it has been pre-empted.
>  
> There is also a counter which increments each servo interrupt where any change would indicate it has been pre-empted 
>  extern
>  
> RegardsvolatiledoubleServoTick; // increments each servo interrupt
> TK
>  
> From: himykabibble <jagboy@...>
> To: DynoMotion@yahoogroups.com
> Sent: Monday, December 5, 2011 10:00 PM
> Subject: [DynoMotion] Thread Switching....
>
>
>  
> Tom,
>
> Am I correct in assuming you are doing pre-emptive task switching, and that if a thread does not cede control before its timeslice is up, it will be suspended until its turn comes around again?
>
> Is there any way to *know* a thread has exceeded its timeslice?
>
> Regards,
> Ray L.
>